Skip to content

fix: prevent accidental deletion if we try to overwrite existing data #540

Draft
jot2re wants to merge 1 commit intomainfrom
tore/fix/2870/prevent-overwriting-when-failing
Draft

fix: prevent accidental deletion if we try to overwrite existing data #540
jot2re wants to merge 1 commit intomainfrom
tore/fix/2870/prevent-overwriting-when-failing

Conversation

@jot2re
Copy link
Copy Markdown
Collaborator

@jot2re jot2re commented Apr 21, 2026

Description of changes

Fix to ensure we do not delete any existing data when we use helper methods to write data that already exists.

Issue ticket number and link

This closes https://github.com/zama-ai/kms-internal/issues/2870

PR Checklist

I attest that all checked items are satisfied. Any deviation is clearly justified above.

  • Title follows conventional commits (e.g. chore: ...).
  • Tests added for every new pub item and test coverage has not decreased.
  • Public APIs and non-obvious logic documented; unfinished work marked as TODO(#issue).
  • unwrap/expect/panic only in tests or for invariant bugs (documented if present).
  • No dependency version changes OR (if changed) only minimal required fixes.
  • No architectural protocol changes OR linked spec PR/issue provided.
  • No breaking deployment config changes OR devops label + infra notified + infra-team reviewer assigned.
  • No breaking gRPC / serialized data changes OR commit marked with ! and affected teams notified.
  • No modifications to existing versionized structs OR backward compatibility tests updated.
  • No critical business logic / crypto changes OR ≥2 reviewers assigned.
  • No new sensitive data fields added OR Zeroize + ZeroizeOnDrop implemented.
  • No new public storage data OR data is verifiable (signature / digest).
  • No unsafe; if unavoidable: minimal, justified, documented, and test/fuzz covered.
  • Strongly typed boundaries: typed inputs validated at the edge; no untyped values or errors cross modules.
  • Self-review completed.

Dependency Update Questionnaire (only if deps changed or added)

Answer in the Cargo.toml next to the dependency (or here if updating):

  1. Ownership changes or suspicious concentration?
  2. Low popularity?
  3. Unusual version jump?
  4. Lacking documentation?
  5. Missing CI?
  6. No security / disclosure policy?
  7. Significant size increase?

More details and explanations for the checklist and dependency updates can be found in CONTRIBUTING.md

@cla-bot cla-bot Bot added the cla-signed The CLA has been signed. label Apr 21, 2026
@github-actions
Copy link
Copy Markdown

Consolidated Tests Results 2026-04-21 - 13:00:41

Test Results

passed 18 passed

Details

tests 18 tests
clock not captured
tool junit-to-ctrf
build build-and-test arrow-right test-reporter link #1531
pull-request fix: prevent accidental deletion if we try to overwrite existing data link #540

test-reporter: Run #1531

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
18 18 0 0 0 0 0 not captured

🎉 All tests passed!

Tests

View All Tests
Test Name Status Flaky Duration
nightly_full_gen_tests_k8s_default_threshld_sequential_crs 32.7s
test_k8s_threshld_insecure 3m 16s
k8s_test_crs_uniqueness 32.7s
k8s_test_insecure_keygen_encrypt_and_public_decrypt 3m 20s
k8s_test_insecure_keygen_encrypt_multiple_types 3m 40s
k8s_test_keygen_and_crs 3m 16s
k8s_test_keygen_uniqueness 8m 58s
nightly_full_gen_tests_k8s_default_centralzd_sequential_crs 1.9s
test_k8s_centralzd_insecure 1m 7s
k8s_test_centralized_insecure 1m 5s
nightly_full_gen_tests_default_k8s_centralized_sequential_crs 1.9s
nightly_full_gen_tests_k8s_default_threshld_sequential_crs 32.8s
test_k8s_threshld_insecure 3m 15s
k8s_test_crs_uniqueness 32.9s
k8s_test_insecure_keygen_encrypt_and_public_decrypt 3m 20s
k8s_test_insecure_keygen_encrypt_multiple_types 3m 42s
k8s_test_keygen_and_crs 3m 16s
k8s_test_keygen_uniqueness 8m 57s

🍂 No flaky tests in this run.

Github Test Reporter by CTRF 💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The CLA has been signed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant